package com.ssy.lingxi.member.merchant.repository;

import com.ssy.lingxi.member.merchant.entity.MemberQualityDO;
import com.ssy.lingxi.member.merchant.entity.MemberRelationDO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 会员资质Jpa仓库
 * @author 万宁
 * @version 2.0.0
 * @date 2021-05-20
 */
@Repository
public interface MemberQualityRepository extends JpaRepository<MemberQualityDO, Long>, JpaSpecificationExecutor<MemberQualityDO> {

    List<MemberQualityDO> findByRelation(MemberRelationDO relationDO);

    @Transactional
    void deleteByRelation(MemberRelationDO relationDO);
}
